<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>cake</title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="css/comm.css" />
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/animate.css"/>
		<link rel="stylesheet" type="text/css" href="css/cake.css"/>
		<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
  		<script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script>
	</head>

	<body>
		<!--头部-->
		<div class="header">
				<div class="container-fluid">
				<nav class="navbar navbar-default container index-top">
					<div class="container-fluid">
						<!-- Brand and toggle get grouped for better mobile display -->
						<div class="navbar-header">
							<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
							<a class="navbar-brand index-logo" href="#">
								<img src="img/logo.png" alt="" class="images" classs="animated jackInTheBox"/>
							</a>
						</div>

						<!-- Collect the nav links, forms, and other content for toggling -->
						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav">
								<li>
									<a href="index.html" class="color-hover">首页 <span class="sr-only">(current)</span></a>
								</li>
								<li>
									<a href="cake.html" class="color-hover">蛋糕</a>
								</li>
								<li>
									<a href="cake.html" class="color-hover">冰淇淋</a>
								</li>
								<li>
									<a href="cake.html" class="color-hover">小切块</a>
								</li>
								<li>
									<a href="distribution.html" class="color-hover">全国配送</a>
								</li>
								<li>
									<a href="#" class="color-hover">企业专区</a>
								</li>
							</ul>
							<ul class="nav navbar-nav navbar-right index-sing">
								<li class="dropdown">
									<a href="#" class="dropdown-toggle color-hover" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">广州 <span class="caret"></span></a>
									<ul class="dropdown-menu">
										<li>
											<a href="#" class="color-hover">深圳</a>
										</li>
										<li>
											<a href="#" class="color-hover">上海</a>
										</li>
										<li>
											<a href="#" class="color-hover">北京</a>
										</li>
										<li>
											<a href="#" class="color-hover">佛山</a>
										</li>
									</ul>
								</li>
								<li>
									<a href="#" class="color-hover">消息</a>
								</li>
								<li>
									<p class="color index-signIn">
										<a href="./sign.html" class="color-hover">登录</a>/
										<a href="register.html" class="color-hover">注册</a>
									</p>
								</li>
								<li>
									<a href="#" class="color-hover">购物车</a>
								</li>
							</ul>
						</div>
						<!-- /.navbar-collapse -->
					</div>
					<!-- /.container-fluid -->
				</nav>
			</div>
		</div>
		
		<!--蛋糕列表-->
		<div class="container">
			<!--蛋糕列表选择-->
			<div class="cake-top row">
				<div class="col-md-12 cake-top-up col-xs-12">
					<div class="cake-ul-tilte col-md-1 col-xs-2"><div class="row">分类：</div></div>
					<ul class="cake-ul clearfix col-md-10 col-xs-10">
						<li class="fl color-hover cake-ul-cat">全部分类</li>
						<li class="fl color-hover">蛋糕</li>
						<li class="fl color-hover">冰淇淋</li>
						<li class="fl color-hover">小切块</li>
						<li class="fl color-hover">咖啡</li>
						<li class="fl color-hover">常温蛋糕</li>
						<li class="fl color-hover">设计师礼品</li>
					</ul>
				</div>
				<div class="col-md-12 cake-top-up col-xs-12">
					<div class="cake-ul-tilte col-md-1 col-xs-2"><div class="row">口味：</div></div>
					<ul class="cake-li clearfix col-md-10 col-xs-10">
						<li class="fl color-hover cake-ul-cat">全部口味</li>
						<li class="fl color-hover">乳脂奶油</li>
						<li class="fl color-hover">慕斯乳酪</li>
						<li class="fl color-hover">巧克力坚果</li>
						<li class="fl color-hover">水果</li>
						<li class="fl color-hover">含酒</li>
						<li class="fl color-hover">咖啡</li>
						<li class="fl color-hover">冰淇淋</li>
					</ul>
				</div>
			</div>
			<div>
				<ul class="col-md-12 cake-content">
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/fd064150fe6c3913d0f996ac5a19ef07.png" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">（新）栗蓉暗香</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">长辈></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">童趣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="cakeData.html" class="cake-content-img">
							<img src="img/594f5f74fb37172927ad4068fd283bc0.png" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/a1fb0b12fb9619098684d74904d7d45c.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="cakeData.html" class="color-hover">百利甜情人</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">情侣></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">人气></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/8d8bc144cd477322cd944d135805c4b9.jpg" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/388a7b27da1199bd96d18692b03c5c32.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">卡百利</a></p>
						<p class="cake-money">¥268.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">情侣></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">童趣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/f5c184a98afac9e350304232c69b2bc5.jpg" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">芒果奶油蛋糕</a></p>
						<p class="cake-money">¥198.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">情侣></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">童趣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/31ad1048931a2871f920a4a69c628fa1.jpg" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">（彼尔德）黑白巧克力慕斯</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">新品></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">童趣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/a4dfb0c5554c6f119024fa8885515bdc.png" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">榴莲飘飘</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">人气></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">新品></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/fee9099f7540971e0bea7bd50b748130.png" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">百香果酸乳酪慕斯蛋糕</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">低温></a>
							<a href="javascript:;">情侣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
					<li class="col-md-3 col-xs-6">
						<a href="javascript:;" class="cake-content-img">
							<img src="img/cc1684f0f14f4d1292659a837768edaf.png" alt="" class="img-responsive center-block"/>
							<div class="cake-content-img-text">
								<img src="img/1e22720bd656f7bac246159010c7e1f4.png" alt=""  class="img-responsive center-block"/>
							</div>
						</a>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">（新）栗蓉暗香</a></p>
						<p class="cake-money">¥298.00/2.0磅</p>
						<div class="cake-list">
							<a href="javascript:;">长辈></a>
							<a href="javascript:;">聚会></a>
							<a href="javascript:;">童趣></a>
						</div>
						<p class="text-overflow" style="text-align: center;"><a href="javascript:;" class="color-hover">加入购物车</a></p>
					</li>
				</ul>
			</div>
		</div>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		<script type="text/javascript">
			$('.cake-ul li').click(function(){
				$(this).addClass('cake-ul-cat').siblings().removeClass('cake-ul-cat')
			})
			$('.cake-li li').click(function(){
				$(this).addClass('cake-ul-cat').siblings().removeClass('cake-ul-cat')
			})
		</script>
		
		<!--自定义动画-->
		<script type="text/javascript">
		lazyRender();
		$(window).on('scroll', function() {
			lazyRender();
		})

		function lazyRender() {
			$('.images').each(function() {
				if(checkShow($(this)) && !isLoaded($(this))) {
					loadImg($(this));
				}
			})
		}
		function checkShow($img) { // 传入一个img的jq对象
			var scrollTop = $(window).scrollTop(); //即页面向上滚动的距离
			var windowHeight = $(window).height(); // 浏览器自身的高度
			var offsetTop = $img.offset().top; //目标标签img相对于document顶部的位置

			if(offsetTop < (scrollTop + windowHeight) && offsetTop > scrollTop) { //在2个临界状态之间的就为出现在视野中的
				return true;
			}
			return false;
		}

		function isLoaded($img) {
			return $img.attr('class') === $img.attr('classs'); //如果data-src和src相等那么就是已经加载过了
		}

		function loadImg($img) { // 加载就是把自定义属性中存放的真实的src地址赋给src属性
			$img.addClass($img.attr('classs'))
		}
	</script>

	</body>

</html>